package cn.ekuma.odbo.mobile.ui

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.openbravo.data.user.DirtyListener
import com.openbravo.data.user.EditorRecord

interface EditorRecordHolder<T>:EditorRecord<T> {

    fun setDirtyListener(l: DirtyListener?)

    fun getEditorViewPanel(inflater: LayoutInflater, container: ViewGroup):View

    fun refresh(item: T?)

    fun currentState():EditorRecordState

    fun setEditorRecordStateChangeListener(listener: EditorRecordStateChangeListener?)

    fun writeValueInsert(item: T)

    fun createValue():T

}

enum class EditorRecordState{INSERT,EDIT,DELETE,EOF}

interface EditorRecordStateChangeListener{
    fun editorRecordStateChange(fromState:EditorRecordState,toState:EditorRecordState)
}